#include "Map.hpp"

Map::Map(): Object2D("", "", 0, 0, 0, 0)
{
}

Map::Map(const int width, const int height): Object2D("", "", width, height, 0, 0)

{
}

void    Map::addTile(Tile* newTile)
{
    _tiles.push_back(newTile);
}

void    Map::draw(QPainter& painter)
{
    std::list<Tile*>::iterator  itBegin = _tiles.begin();
    std::list<Tile*>::iterator  itEnd = _tiles.end();

    while (itBegin != itEnd)
    {
        (*itBegin)->draw(painter, _positionX, _positionY);
        ++itBegin;
    }
}

std::list<Tile*>*   Map::getTiles()
{
    return &_tiles;
}
